menu = new PopupMenu.RemoteMenu(this.actor, this._targetApp.menu, this._targetApp.action_group);
} else {
- if (this.menu && !(this.menu instanceof PopupMenu.RemoteMenu))
+ if (this.menu && this.menu.isDummyQuitMenu)
return;
// fallback to older menu
menu = new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.TOP, 0);
+ menu.isDummyQuitMenu = true;
menu.addAction(_("Quit"), Lang.bind(this, function() {
this._targetApp.request_quit();
}));
this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress));
if (dontCreateMenu)
- this.menu = null;
+ this.menu = new PopupMenu.PopupDummyMenu(this.actor);
else
this.setMenu(new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, 0));
}
});
+const PopupDummyMenu = new Lang.Class({
+ Name: 'PopupDummyMenu',
+
+ _init: function(sourceActor) {
+ this.sourceActor = sourceActor;
+ this.actor = sourceActor;
+ this.actor._delegate = this;
+ },
+
+ isChildMenu: function() {
+ return false;
+ },
+
+ open: function() { this.emit('open-state-changed', true); },
+ close: function() { this.emit('open-state-changed', false); },
+ destroy: function() {
+ this.emit('destroy');
+ },
+});
+Signals.addSignalMethods(PopupDummyMenu.prototype);
+
const PopupSubMenu = new Lang.Class({
Name: 'PopupSubMenu',
Extends: PopupMenuBase,